﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    public partial class Form2 : Form
    {
        public Form2()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "刘茂" && textBox2.Text == "2018131340")
            {
                MessageBox.Show("登录成功", "成功信息");
                this.Hide();               //窗口1执行后 隐藏
                Form1 forml = new Form1(); //实例化窗口2
                forml.ShowDialog();        //弹出新窗口2
                this.Close();              //关闭窗口1
            }
            else
            {
                MessageBox.Show("账号或密码错误", "提示信息");
            }
        }
    }
}
